Return to doc.sitecore.com

Valid for Sitecore All Releases, 5.2, 5.3
How can I include the current date in an XSL rendering?

Q:

How can I include the current date in an XSL rendering? 

A:

The goal is achieved by performing the following steps: 

The whole solution looks like this:

Add the following entry under /configuration/sitecore/xslExtensions in the web.config file:

Update the XSL:

  xmlns:dateutil="http://www.sitecore.net/dateutil"
  exclude-result-prefixes="dot sc dateutil"

Use the method:

<xsl:variable name="now" select="dateutil:get_IsoNow()" />
<xsl:value-of select="sc:formatdate( $now, 'MMM d, yyyy' )" />